
pwd

echo "Only support the nginx server."
echo "Make the base direcotry."
mkdir /var/www/SITES/ktlog

echo "Make the check-disk direcotry."
mkdir /var/www/SITES/ktlog/check-disk

echo "Make the reveiw-nginx-report direcotry."
mkdir /var/www/SITES/ktlog/review-nginx-report

echo "Change the directory owner."
chown -R apache.apache /var/www/SITES/ktlog

echo "Setup the check-disk script."
mkdir /lin/logs-script
cp logs-check-disk.sh /lin/logs-script/logs-check-disk.sh
cp logs-make-nginx-log.sh /lin/logs-script/logs-make-nginx-log.sh

echo "Set the nginx auto restart."
echo "1 * * * * service nginx restart" >> /var/spool/cron/root

echo "Set auto check fisk-disk plance."
echo "2 * * * * /lin/logs-script/logs-check-disk.sh" >> /var/spool/cron/root

echo "Set auto nginx report."
echo "5 1 * * * /lin/logs-script/logs-make-nginx-log.sh" >> /var/spool/cron/root
echo "5 13 * * * /lin/logs-script/logs-make-nginx-log.sh" >> /var/spool/cron/root

service crond restart


